//
//  LBFeedItemModel.h
//  look.book
//
//  Created by Chih Yuan Liu on 3/23/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "LBFeedItem.h"
#import "CTPBaseUrlFetcher.h"
#import "FeedParser.h"


@class LBFeedItemModel;

@protocol LBFeedItemDelegate

- (void)fetcherBegin:(LBFeedItemModel*)sender;
- (void)fetcherEnd:(LBFeedItemModel*)sender;
- (void)fetcherSucceeded:(LBFeedItemModel*)sender updates:(NSArray*) updates;
- (void)fetcherFailed:(LBFeedItemModel*)sender;

@end


@interface LBFeedItemModel : CTPBaseUrlFetcher {
	NSMutableArray * feeds;
	NSMutableArray * keys;
	FeedParser * parser;
	NSObject<LBFeedItemDelegate> * delegate;
}


@property (readwrite, retain) NSObject<LBFeedItemDelegate> *delegate;


-(id) initWithDelegate:(NSObject<LBFeedItemDelegate>*)_delegate;

-(void) refresh;

-(NSInteger) GetCount;

-(LBFeedItem*) GetItemAtIndex:(int)index;

-(void) removeFromModel:(LBFeedItem*)item;

@end
